<?xml version="1.0" encoding="utf-8" ?> 
<taskrunner name="copyfiles" version="1.0" date="2008-10-30" maxthreads="1"> 
  <!--copies and register files -->
  
  <includes> 
    <file name="vida.install.settings.xml" /> 
  </includes>

  <parameters>
    <parameter name="request.x64" value="input#" />
  </parameters>
  
  <enumerations> 
    
    <!-- 
      All files in the below enum table will be copied to %SystemToot\System32 directory 
      Use the attribute "register" and set it to "true" for all files that needs to be registered by RegSvr32
      
      For now the source directory of the files is ${install.src.diag.dir}. 
      
      2009-09-28/MMA  Changed function call for task "copy" from FileCopy to MoveFileEX
      
    -->
    <enum name="windows.system32.files">      
      <!-- java -->
      <item key="jRegistryKey.dll" register="false" critical="true"/>     
    </enum>

    <enum name="x40reprogrammer">    
    </enum>
    
  </enumerations>
  
  <tasks> 
    <foreach enum="windows.system32.files">
      
      <task name="remove-r-attribute" allowMultipleInstances="true" typename="@CommandLine">
        <parameters>
          <parameter name="arguments" value="attrib -r /s $[windows.system32.files:key]"/>
          <parameter name="workingdirectory" value="%{SystemRoot}\System32"/>
          <parameter name="useCmdExe" value="true"/>
        </parameters>
      </task>
      
      <task name="copy" allowMultipleInstances="true" critical="$[windows.system32.files:critical]" condition="${request.x64}=false" typename="@MoveFileEX">
        <dependencies list="remove-r-attribute"/>
        <parameters> 
          <parameter name="src" value="${install.src.diag.dir}\$[windows.system32.files:key]"/> 
          <parameter name="dst" value="%{SystemRoot}\System32\$[windows.system32.files:key]"/> 
       </parameters>
      </task>

      <task name="copyX64" allowMultipleInstances="true" critical="$[windows.system32.files:critical]" condition="${request.x64}=true" typename="@MoveFileEX">
        <dependencies list="remove-r-attribute"/>
        <parameters>
          <parameter name="src" value="${install.src.diag.dir}\$[windows.system32.files:key]"/>
          <parameter name="dst" value="%{SystemRoot}\SysWoW64\$[windows.system32.files:key]"/>
        </parameters>
      </task>

      <task name="register" allowMultipleInstances="true" critical="$[windows.system32.files:critical]" typename="@RegSvr32"  condition="$[windows.system32.files:register]=true"> 
        <dependencies list="copy"/> 
        <parameters> 
          <parameter name="component.fullpath" value="%{SystemRoot}\System32\$[windows.system32.files:key]"/> 
        </parameters>
      </task>

  </foreach>

   <foreach enum="x40reprogrammer">
     
     <task name="x40.remove-r-attribute" allowMultipleInstances="true" typename="@CommandLine">
       <parameters>
         <parameter name="arguments" value="attrib -r /s $[x40reprogrammer:key]"/>
         <parameter name="workingdirectory" value="%{SystemRoot}\System32"/>
         <parameter name="useCmdExe" value="true"/>
       </parameters>
     </task>

     <task name="x40.copy" allowMultipleInstances="true" typename="@MoveFileEX">
       <dependencies list="x40.remove-r-attribute"/>
       <parameters>
         <parameter name="src" value="${install.src.diag.dir}\x40reprog\$[x40reprogrammer:key]"/>
         <parameter name="dst" value="%{SystemRoot}\System32\$[x40reprogrammer:key]"/>
       </parameters>
     </task>

     <task name="x40.register" allowMultipleInstances="true" typename="@RegSvr32" condition="$[x40reprogrammer:register]=true">
       <dependencies list="x40.copy"/>
       <parameters>
         <parameter name="component.fullpath" value="%{SystemRoot}\System32\$[x40reprogrammer:key]"/>
       </parameters>
     </task>
     
   </foreach>
    
</tasks>
  
</taskrunner>
